import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork" 

// 缴库单位
export const TreasurySinglePosition = () => {
    return service.post<any,any>(`/back/getStcColQuery`)
}

// 针车补制明细查询
export interface NeedleRepairSystemDetailsQueryParms{
    deptNo:string,
    lotNo:string,
    pageNum:number,
    pageSize:number,
    slipDateEnd:string,
    slipDateStart:string,
    slipNo:string,
    style:string
}

export interface NeedleRepairSystemDetailsQueryInterface{
    total?:number,
    dtos:dtosList[]
}

interface dtosList{
    deptName: string,
    slipDate: string,
    lotNo: string,
    qty: number,
    remark: null | string,
    slipNo: string
}

export const NeedleRepairSystemDetailsQuery = (parms:NeedleRepairSystemDetailsQueryParms) => {
    return service.put<any,NeedleRepairSystemDetailsQueryInterface>(`/pcFactorStockQuery/getStcSupQuery`,parms)
}

// 针车补料明细查询
export const NeedleCarInstructionFillDetailQuery = (lotNo:string) => {
    return service.post<any,any>(`/pcFactorStockQuery/getStcSupLotQuery?lotNo=${lotNo}`)
}

// 针车补料明细删除
export interface NeedleFillingDetailDeletedParms {
    deptName:any,
    deptNameNew:string,
    deptNo:string,
    deptNoNew:string,
    lotNo:string,
    qty:string,
    qtyNew:string,
    remark:string,
    remarkNew:string,
    slipDate:string,
    slipDateNew:string,
    slipNo:string
}

export const NeedleFillingDetailDeleted = (parms:NeedleFillingDetailDeletedParms) => {
    return LoginWork.put<any,any>(`/pcFactorStockQuery/stcSupDelete`,parms)
}

// 针车补料明细新增
export const NeedleFillingDetailsAdded = (parms:NeedleFillingDetailDeletedParms) => {
    return LoginWork.put<any,any>(`/pcFactorStockQuery/stcSupAdd`,parms)
}